import App from './App'

// #ifndef VUE3
import Vue from 'vue'
import uView from "uview-ui";
import store from './store/store.js'
// 按需导入 $http 对象
import {
	$http
} from '@escook/request-miniprogram'


uni.$http = $http
$http.baseUrl = 'https://asiayun.com'
// 请求开始之前做一些事情
$http.beforeRequest = function(options) {
	options.header = {
		'authorization': 'authorization:JWT ' + store.state.loginModules.jwtToken,
	}
}
// 封装弹框的消息
uni.$showMsg = function(title = '请求失败或未登录！', duration = 2500) {
	uni.showToast({
		title,
		duration,
		icon: 'none'
	})
}


Vue.use(uView);

Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
	...App,
	store
})
app.$mount()
// #endif
